package com.ice.framework.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter

class CommonViewPagerAdapter(supportFragmentManager: FragmentManager, behavior: Int=FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) : FragmentPagerAdapter(supportFragmentManager, behavior) {
    var fragments: ArrayList<Fragment> = ArrayList()
        set(value) {
            field = value
            notifyDataSetChanged()
        }

    override fun getItem(position: Int): Fragment =fragments[position]

    override fun getCount(): Int=fragments.size
}